← Back
Editing: crud_octets_content_type.test
## Varius tests octets content type ## Preamble --source ../include/xplugin_preamble.inc ## Test data DROP SCHEMA IF EXISTS xtest; CREATE SCHEMA xtest; USE xtest; CREATE TABLE xtable (f int); INSERT INTO xtable (f) VALUES (42); ## Test starts here --write_file $MYSQL_TMP_DIR/crud_octets_content_type.tmp ##-- GEOMETRY type Mysqlx.Crud.Find { collection { name: "xtable" schema: "xtest" } data_model: TABLE projection { source { type: FUNC_CALL function_call { name { name: "st_astext" } param { type: LITERAL literal { type: V_OCTETS v_octets {value:'\001\001\000\000\000\000\000\000\000\000\000\360\077\000\000\000\000\000\000\360\077' content_type:1} } } } } } } -->recvresult ##-- JSON type Mysqlx.Crud.Find { collection { name: "xtable" schema: "xtest" } data_model: TABLE projection { source { type: FUNC_CALL function_call { name { name: "json_valid" } param { type: LITERAL literal { type: V_OCTETS v_octets {value:'{"ala":1}' content_type:0} } } } } } projection { source { type: FUNC_CALL function_call { name { name: "json_valid" } param { type: LITERAL literal { type: V_OCTETS v_octets {value:'{"ala":1}' content_type:2} } } } } } } -->recvresult ##-- XML type Mysqlx.Crud.Find { collection { name: "xtable" schema: "xtest" } data_model: TABLE projection { source { type: FUNC_CALL function_call { name { name: "extractvalue" } param { type: LITERAL literal { type: V_OCTETS v_octets {value:'<a>b</a>' content_type:0} } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:'/a' content_type:0} } } } } } projection { source { type: FUNC_CALL function_call { name { name: "extractvalue" } param { type: LITERAL literal { type: V_OCTETS v_octets {value:'<a>b</a>' content_type:3} } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:'/a' content_type:0} } } } } } } -->recvresult EOF --exec $MYSQLXTEST -uroot --password='' --file=$MYSQL_TMP_DIR/crud_octets_content_type.tmp 2>&1 --remove_file $MYSQL_TMP_DIR/crud_octets_content_type.tmp ## Postamble DROP SCHEMA IF EXISTS xtest; UNINSTALL PLUGIN mysqlx;
Save File
Cancel